import request from '../utils/request.js'

export const login = (data) => {
  return request.post('/login', data)
}
//获取侧边栏
export const huoLogin = () => {
  return request.get('/menus')
}
// 获取用户列表和搜索
export const huoQuLogin = (data) => {
  return request.get('/users', { params: data })
}
//添加
export const tianJia = (data) => {
  return request.post('/users', data)
}
//修改
export const xiuGai = (data) => {
  return request.put('/users/' + data.id, data)
}
// 删除
export const shanChu = (id) => {
  return request.delete(`/users/${id}`,)
}

export const zhuangTai = (data) => {
  return request.put(`/users/${data.id}/state/${data.bool}`,
  )
}
//点击权限管理获取
export const xiangQin = (id) => {
  return request.get(`/users/${id}`,)
}
// 权限分配

export const quanXian = (obj) => {
  return request.put(`/users/${obj.id}/role`, { data: { rid: obj.rid } })
}

